﻿@model CargoVM

<div class="w-100 card border-0 p-4">
    <div class="card-header bg-success bg-gradient m-lg-0 py-3">
        <div class="row">
            <div class="col-12 text-center">
                <h2 class="text-white py-2">更新货物</h2>
            </div>
        </div>
    </div>
    <div class="card-body border p-4">
        <form method="post" class="row">
            <input asp-for="Cargo.Id" hidden/>
            <div class="p-3">
                @* <div asp-validation-summary="ModelOnly"></div> *@
                <div class="form-floating py-2 col-12">
                    <select asp-for="@Model.Cargo.SupplierId" asp-items="@Model.SupplierList" class="form-select border shadow">
                        <option disabled selected>--Select Supplier--</option>
                    </select>
                    <label asp-for="Cargo.SupplierId" class="ms-2">供应商</label>
                    <span asp-validation-for="Cargo.SupplierId" class="text-danger"></span>
                </div>

                <div class="form-floating py-2 col-12">
                    <input asp-for="Cargo.CargoName" class="form-control border shadow" />
                    <label asp-for="Cargo.CargoName" class="ms-2">货物名称</label>
                    <span asp-validation-for="Cargo.CargoName" class="text-danger"></span>
                </div>
                <div class="form-floating py-2 col-12">
                    <input asp-for="Cargo.CargoCode" class="form-control border shadow" />
                    <label asp-for="Cargo.CargoCode" class="ms-2">货物代码</label>
                    <span asp-validation-for="Cargo.CargoCode" class="text-danger"></span>
                </div>

                <div class="form-floating py-2 col-12">
                    <input asp-for="Cargo.Brand" class="form-control border shadow" />
                    <label asp-for="Cargo.Brand" class="ms-2">品牌</label>
                    <span asp-validation-for="Cargo.Brand" class="text-danger"></span>
                </div>
                <div class="form-floating py-2 col-12">
                    <input asp-for="Cargo.Spcf" class="form-control border shadow" />
                    <label asp-for="Cargo.Spcf" class="ms-2">规格型号</label>
                    <span asp-validation-for="Cargo.Spcf" class="text-danger"></span>
                </div>

                <div class="form-floating py-2 col-12">
                    <input asp-for="Cargo.HSCode" class="form-control border shadow" />
                    <label asp-for="Cargo.HSCode" class="ms-2">HSCode</label>
                    <span asp-validation-for="Cargo.HSCode" class="text-danger"></span>
                </div>
                <div class="form-floating py-2 col-12">
                    <input asp-for="Cargo.Price" class="form-control border shadow" />
                    <label asp-for="Cargo.Price" class="ms-2">单价</label>
                    <span asp-validation-for="Cargo.Price" class="text-danger"></span>
                </div>

                <div class="form-floating py-2 col-12">
                    <input asp-for="Cargo.Unit" class="form-control border shadow" />
                    <label asp-for="Cargo.Unit" class="ms-2">计量单位</label>
                    <span asp-validation-for="Cargo.Unit" class="text-danger"></span>
                </div>
                <div class="form-floating py-2 col-12">
                    <input asp-for="Cargo.Curr" class="form-control border shadow" />
                    <label asp-for="Cargo.Curr" class="ms-2">货币</label>
                    <span asp-validation-for="Cargo.Curr" class="text-danger"></span>
                </div>

                <div class="form-floating py-2 col-12">
                    <input asp-for="Cargo.Package" class="form-control border shadow" />
                    <label asp-for="Cargo.Package" class="ms-2">包装</label>
                    <span asp-validation-for="Cargo.Package" class="text-danger"></span>
                </div>
                <div class="form-floating py-2 col-12">
                    <input asp-for="Cargo.Vol" class="form-control border shadow" />
                    <label asp-for="Cargo.Vol" class="ms-2">体积</label>
                    <span asp-validation-for="Cargo.Vol" class="text-danger"></span>
                </div>
                <div class="form-floating py-2 col-12">
                    <input asp-for="Cargo.Length" class="form-control border shadow" />
                    <label asp-for="Cargo.Length" class="ms-2">长</label>
                    <span asp-validation-for="Cargo.Length" class="text-danger"></span>
                </div>
                <div class="form-floating py-2 col-12">
                    <input asp-for="Cargo.Width" class="form-control border shadow" />
                    <label asp-for="Cargo.Width" class="ms-2">宽</label>
                    <span asp-validation-for="Cargo.Width" class="text-danger"></span>
                </div>

                <div class="form-floating py-2 col-12">
                    <input asp-for="Cargo.Height" class="form-control border shadow" />
                    <label asp-for="Cargo.Height" class="ms-2">高</label>
                    <span asp-validation-for="Cargo.Height" class="text-danger"></span>
                </div>
                <div class="form-floating py-2 col-12">
                    <input asp-for="Cargo.GrossWt" class="form-control border shadow" />
                    <label asp-for="Cargo.GrossWt" class="ms-2">毛重</label>
                    <span asp-validation-for="Cargo.GrossWt" class="text-danger"></span>
                </div>
                <div class="form-floating py-2 col-12">
                    <input asp-for="Cargo.NetWt" class="form-control border shadow" />
                    <label asp-for="Cargo.NetWt" class="ms-2">净重</label>
                    <span asp-validation-for="Cargo.NetWt" class="text-danger"></span>
                </div>

                <div class="form-floating py-2 col-12">
                    <input asp-for="Cargo.MinNum" class="form-control border shadow" />
                    <label asp-for="Cargo.MinNum" class="ms-2">安全库存</label>
                    <span asp-validation-for="Cargo.MinNum" class="text-danger"></span>
                </div>
                <div class="form-floating py-2 col-12">
                    <input asp-for="Cargo.MaxNum" class="form-control border shadow" />
                    <label asp-for="Cargo.MaxNum" class="ms-2">最大库存</label>
                    <span asp-validation-for="Cargo.MaxNum" class="text-danger"></span>
                </div>



                <div class="row pt-2">
                    <div class="col-6 col-md-3">
                        <button type="submit" class="btn btn-success w-100">
                            <i class="bi bi-check-circle"></i> Update
                        </button>
                    </div>
                    <div class="col-6 col-md-3">
                        <a asp-controller="Cargo" asp-action="Index" class="btn btn-secondary w-100">
                            <i class="bi bi-x-circle"></i> Cancel
                        </a>
                    </div>
                </div>
            </div>
        </form>
    </div>
</div>


@section Scripts {
    @{
        <partial name="_ValidationScriptsPartial" />
    }
}